<!-- 左侧面板 -->
<template>
  <ModelTile class="hyqk" title="战新产业" :is-download="false" :is-more="false">
    <div class="hyqk-content">
      <ZTable :columns="columns" :data-source="aicInfos" size="small" :pagination="false"  :scroll="{ y: 90 }"> </ZTable>
    </div>
  </ModelTile>
</template>
<script lang="ts">
import { ref, defineComponent, computed ,inject} from 'vue'
import ModelTile from '@/components/modleTitle/index.vue'
import ZTable from '@/components/z-table/index'
import { Column } from '@/interface/table'
import { useRouter } from 'vue-router'
const httpApi: any = inject('$http')
const listDataBank = ref([])
function getInitData() {
  /**
  httpApi.cityFixedAssets1Api
    .warOnNewIndustries({})
    .then((res: any) => {
      if (res.success) {
        listDataBank.value = res.body || []
      } else {
        console.error('系统异常')
      }
    })
    .catch((err: any) => {
      console.error(err || '系统异常')
    })
	*/
    listDataBank.value = [
      { aicName: '制造业', invCrColor: '20亿', reserveRateColor: '2%' },
      { aicName: '工业节能', invCrColor: '30亿', reserveRateColor: '5%' },
      { aicName: '汽车', invCrColor: '40亿', reserveRateColor: '60%' },
      { aicName: '电子', invCrColor: '50亿', reserveRateColor: '60%' },
      { aicName: '发改委5', invCrColor: '80亿', reserveRateColor: '60%' },
      { aicName: '发改委6', invCrColor: '20亿', reserveRateColor: '60%' },
      { aicName: '发改委7', invCrColor: '20亿', reserveRateColor: '60%' },
      { aicName: '发改委8', invCrColor: '20亿', reserveRateColor: '60%' },
      { aicName: '发改委9', invCrColor: '20亿', reserveRateColor: '60%' }
    ];
}
getInitData()
export default defineComponent({
  name: 'hyqk',
  components: {
    ModelTile,
    ZTable
  },
  props: {
    // 父级统计数据
    statAllData: {
      type: Object,
      default: {}
    }
  },
  setup(props) {
    const router = useRouter()
    // 表头
    const columns: Column[] = [
      {
        dataIndex: 'aicName',
        title: '产业类别',
        width: '35%',
        ellipsis: true,
        align: 'left'
      },
      {
        dataIndex: 'invCrColor',
        title: '完成投资金额',
        width: '45%',
        ellipsis: true,
        align: 'left'
      },
      {
        dataIndex: 'reserveRateColor',
        title: '同比',
        width: '20%',
        ellipsis: true,
        align: 'left'
      }
    ]
	const listData = listDataBank;
    // 通过计算属性实时获取父级传递的 列表数据
    const aicInfos = computed(() => props.statAllData?.aicInfos || listData.value)
    // 获取icon
    function getImage(name: string) {
      return new URL(`/src/assets/images/pageHome/${name}.png`, import.meta.url).href
    }
    return {
      columns,
      aicInfos,

      getImage
    }
  }
})
</script>
<style lang="scss" scoped>
@import '@/components/z-table/common.scss';
.hyqk {
  color: #fff;

  :deep(.content) {
    padding: 0;
    border-radius: 12vh * $Bh;
    height: 550vh * $Bh;
    background-color: initial;
  }
  
  .hyqk-content {
    padding: 0 0vw * $w 0 0vw * $w;
    height: 100%;
    .tz {
      display: flex;
      align-items: center;
      height: 30vh * $h;
      padding-bottom: 3vh * $h;
      img {
        width: 25vh * $h;
        height: 25vh * $h;
      }
    }
  }
}
</style>
